﻿<!-- #Include File="Skin.asp" -->
<%
sql = "select distinct Country from City order by Country asc"
Call Exec(rs,sql,2)
if not(rs.bof and rs.eof)Then
s="var country=[{data:[['','请选择国家']"
do while not rs.eof
s=s&",'" & rs(0) & "'"
rs.movenext
loop
s=s&"]}];"
end if
response.write s

sql = "select Country,Province from City group by Country,Province order by Country asc,Province asc"
Call Exec(rs,sql,2)
if not(rs.bof and rs.eof)Then
s="var province=[{value:'',data:[['','请选择省/直辖市']"
p = ""
c = ""
do while not rs.eof
if p = rs(0) Then
s=s & ",'" & rs(1) & "'"
else
s=s & "]},{value:'" & rs(0) & "',data:[['','请选择省/直辖市'],'" & rs(1) & "'"
end if
p = rs(0)
c = rs(1)
rs.movenext
loop
s=s&"]}];"
end if
response.write s

sql = "select Province,City from City group by Province,City order by Province asc,City asc"
Call Exec(rs,sql,2)
if not(rs.bof and rs.eof)Then
s="var city=[{value:'',data:[['','请选择市']"
p = ""
c = ""
do while not rs.eof
if p = rs(0) Then
s=s & ",'" & rs(1) & "'"
else
s=s & "]},{value:'" & rs(0) & "',data:[['','请选择市'],'" & rs(1) & "'"
end if
p = rs(0)
c = rs(1)
rs.movenext
loop
s=s&"]}];"
end if
response.write s

sql = "select City,Area from City group by City,Area order by City asc,area asc"
Call Exec(rs,sql,2)
if not(rs.bof and rs.eof)Then
s="var area=[{value:'',data:[['','请选择区']"
p = ""
c = ""
do while not rs.eof
if p = rs(0) Then
s=s & ",'" & rs(1) & "'"
else
s=s & "]},{value:'" & rs(0) & "',data:[['','请选择区'],'" & rs(1) & "'"
end if
p = rs(0)
c = rs(1)
rs.movenext
loop
s=s&"]}];"
end if
response.write s
%>